-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalizing Online-DDL queries #7153
Normalizing Online-DDL queries #7153
Conversation
- CREATE INDEX formats onto ALTER TABLE - DROP TABLE <multi> - exploded into multiple single-table DROP statements Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
go/vt/schema/parser_test.go
Outdated
"drop database t": {isError: true}, | ||
} | ||
for query, expect := range tests { | ||
normalized, err := NormalizeOnlineDDL(query) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
for query, expect := range tests {
t.Run(query, func(t *testing.T) {
...
})
}
sub tests makes it look good in test output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL actually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Still have some tests to fix. |
Signed-off-by: GuptaManan100 <manan@planetscale.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Documentation: vitessio/website#638 |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Backport
NO
Status
REAFY
Description
In this PR we normalize some DDL queries sent as Online DDL:
CREATE INDEX
formats ontoALTER TABLE
: this is becausegh-ost
andpt-osc
only know how to handleALTER TABLE
statements. As there is no specific advantage to usingCREATE INDEX
over the equivalentCREATE TABLE... ADD INDEX
we choose to haveCreateIndex.Format()
function export asALTER TABLE
DROP TABLE <multi>
- exploded into multiple single-tableDROP
statementsRelated Issue(s)
#6926 (comment)
Todos
Impacted Areas in Vitess
List general components of the application that this PR will affect:
Notes
@GuptaManan100 @systay please notice the following test from
parse_test.go
:The output is incorrect; still to understand why, I think the problem is with the parser, not with the Format. FWIW MySQL itself is unhappy about that complex CREAT EINDEX query.